import request from '@/utils/request'

export interface TabsItemModel {
    cid: number
    name: string
    pageView: number
    title: string
}
export interface TabsListModel {
    categories: []
}

export interface SubjectsModel{
    id: number
    coverPathSmall: string | undefined
    coverImgUrl: string
    title:string
    dataCount: number
    releaseAt: number | string
    contentType: number
    pageView: string
    intro: string
    authorNickName: string
    authorAvatar: string
    authorId: number
    categoryId: number
    categoryName: string
    categoryTitle:string
    url: string
}


export interface SybjectModel{
    pageNo: number
    pageSize: number
    hasMore: boolean
    totalCount: number
    categoryId: number
    categoryName: string
    categoryTitle: string
    subjects: SubjectsModel[]
}
// revision/subject/category
// revision/subject/categorySubjectList/{title}?pageNum={pageNum}&pageSize={pageSize}
export default {
    getTabsList() {
        return request.get<any, TabsListModel>(`/revision/subject/category`)
    },
    getSubjectList(title: string, pageNum: number = 1, pageSize: number = 20) {
        return request.get<any,SybjectModel>(`revision/subject/categorySubjectList/${title}?pageNum=${pageNum}&pageSize=${pageSize}`)
    }
}